#include<stdio.h>
int main(){
    int n,i;
    double sum=0;
    scanf("%d",&n);
    for(i=0;i<n;i++){
        if(i%2==0){
            sum+=1.0/(3*i+1.0);
        }
        else{
            sum-=1.0/(3*i+1.0);
        }
    }
    printf("sum = %.3lf\n",sum);
    return 0;
}